package com.situ.mall.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.situ.mall.common.entity.Member;
import com.situ.mall.common.entity.MemberAddress;
import com.situ.mall.common.mapper.MemberAddressMapper;
import com.situ.mall.common.service.IMemberAddressService;
import com.situ.mall.common.util.RequestUtil;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author kkkkkk
 * @since 2023-09-18
 */
@Service
public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, MemberAddress> implements IMemberAddressService {

    @Override
    public List<MemberAddress> getCurrentMemberAddress() {
        Member o = (Member) RequestUtil.getCurrent();

        return baseMapper.selectList(new LambdaQueryWrapper<MemberAddress>().eq(MemberAddress::getMemberId, o.getId()));
    }
}
